package com.budwk.app.miniapp.controllers.admin.spring;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.budwk.app.miniapp.models.DictDataWithSubLists;
import com.budwk.app.miniapp.models.SysDictData;
import com.budwk.app.miniapp.models.WxEvent;
import com.budwk.app.miniapp.models.vo.EventScheduleDetailVO;
import com.budwk.app.miniapp.models.vo.WxEventStatisticVO;
import com.budwk.app.miniapp.services.SysdictdataService;
import com.budwk.app.miniapp.services.WxeventService;
import com.budwk.app.miniapp.services.WxeventscheduleService;
import com.budwk.app.miniapp.utils.DistanceUtils;
import com.budwk.app.miniapp.utils.ExcelUtils;
import com.budwk.starter.common.openapi.annotation.*;
import com.budwk.starter.common.page.Pagination;
import com.budwk.starter.common.result.Result;
import com.budwk.starter.common.result.ResultCode;
import com.budwk.starter.log.annotation.SLog;
import com.budwk.starter.security.utils.SecurityUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.nutz.dao.Cnd;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.*;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

@IocBean
@At("/weixin/event")
@ApiDefinition(tag = "微信小程序-事件管理(求助/求救)")
@Slf4j
public class WxEventSpringController {
    @Inject
    private WxeventService wxEventService;

    @Inject
    private SysdictdataService sysdictdataService;

    @Inject
    private WxeventscheduleService wxeventscheduleService;

    @Inject
    private RedissonClient redissonClient;







    @At
    @Ok("json")
    @GET
    public  Result<?> dictList(@Param("::") SysDictData data) {
      List<SysDictData> list=  sysdictdataService.query(Cnd.where(SysDictData::getDictType,"=",data.getDictType())
              .and(SysDictData::getStatus,"=",0).desc("dict_sort"));
        return Result.success(list);
    }

}
